﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            string Username1 = Request.Form["username"];
            string Password1 = Request.Form["password"];

            string Username2 = Request.QueryString["username"];
            string Password2 = Request.QueryString["password"];

            string Username3 = Request.Params["username"];
            string Password3 = Request.Params["password"];

            Response.Write("Form ==>" + Username1 + "<br/>");
            Response.Write("Form ==>" + Password1 + "<br/>");
            Response.Write("QueryString ==>" + Username2 + "<br/>");
            Response.Write("QueryString ==>" + Password2 + "<br/>");
            Response.Write("Params ==>" + Username3 + "<br/>");
            Response.Write("Params ==>" + Password3 + "<br/>");

            Literal1.Text = $"欢迎！！{Username1}密码:{Password1}";

            if (PreviousPage != null)
            {
                TextBox Username = (TextBox)PreviousPage.FindControl("username");
                TextBox Password = (TextBox)PreviousPage.FindControl("password");

                if (Username != null)
                {
                    string Username4 = Username.Text;
                    Response.Write("PreviousPage ==>" + Username4 + "<br/>");
                }
                if (Password != null)
                {
                    string Password4 = Password.Text;
                    Response.Write("PreviousPage ==>" + Password4 + "<br/>");
                }
            }


        }
    }
}